/*
 * @Description:
 * @Author: hwl
 * @Date: 2023-12-07 10:30:20
 */
import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
export const constantRoutes: Array<RouteRecordRaw> = [
	{
		path: "/discover",
		name:"discover",
		component: () => import(/* webpackChunkName: "dashboard" */ "@/pages/discover/index.vue"),
		meta: { title:"首页",icon:'home', iconps:'0px',iconps_active:'-24px' },
	},
	{
		path: "/",
		name:"recommend",
		meta:{title:"推荐",icon:'recommend',iconps:'-48px',iconps_active:'-72px' },
		component: () => import(/* webpackChunkName: "dashboard" */ "@/pages/recommend/index.vue"),
	},
	{
		path: "/follow",
		name:"follow",
		meta:{title:"关注",icon:'follow',iconps:'-96px',iconps_active:'-120px'},
		component: () => import(/* webpackChunkName: "dashboard" */ "@/pages/follow/index.vue"),
	},
	{
		path: "/friend",
		name:"friend",
		meta:{title:"朋友",icon:'friend',iconps:'-144px',iconps_active:'-168px'},
		component: () => import(/* webpackChunkName: "dashboard" */ "@/pages/friend/index.vue"),
	},
	{	

		path: '/user',
		meta:{title:"我的",'icon':'dongtai', iconps:'96px',iconps_active:'72px'},
		name:"user",
		component: () => import(/* webpackChunkName: "dashboard" */ "@/pages/user/index.vue"),
		redirect:"/user/self",
		children: [
			{
				path: "self",
				name:"user-self",
				component: () => import(/* webpackChunkName: "dashboard" */ "@/pages/user/self.vue"),
				meta: {
					title: "我的",
					affix: true,
				},
			}
		],
	},
	{
		path: "/live",
		name:"live",
		meta:{title:"直播",icon:'live'},
		component: () => import(/* webpackChunkName: "dashboard" */ "@/pages/live/index.vue"),
	},
	{
		path: "/vs",
		name:"vs",
		meta:{title:"放映厅",icon:'vs', iconps:'576px',iconps_active:'552px'},
		component: () => import(/* webpackChunkName: "dashboard" */ "@/pages/vs/index.vue"),
	},
	{
		path: "/channel/10001",
		name:"knowledge",
		meta:{title:"知识",icon:'setting', iconps:'432px',iconps_active:'408px'},
		component: () => import(/* webpackChunkName: "dashboard" */ "@/pages/channel/knowledge.vue"),

	},
	{
		path: "/hot",
		name:"hot",
		meta:{title:"热点",icon:'hot',iconps:'528px',iconps_active:'504px'},
		component: () => import(/* webpackChunkName: "dashboard" */ "@/pages/hot/index.vue"),
	},
	{
		path: "/channel/10002",
		name:"game",
		meta:{title:"游戏",icon:'game', iconps:'336px',iconps_active:'312px'},
		component: () => import(/* webpackChunkName: "dashboard" */ "@/pages/channel/game.vue"),
	},
	{
		path: "/channel/10003",
		name:"entertainment",
		meta:{title:"娱乐",icon:'entertainment', iconps:'480px',iconps_active:'456px'},
		component: () => import(/* webpackChunkName: "dashboard" */ "@/pages/channel/entertainment.vue"),
	},
	{
		path: "/channel/10004",
		name:"cospa",
		meta:{title:"二次元",icon:'cospa', iconps:'384px',iconps_active:'360px'},
		component: () => import(/* webpackChunkName: "dashboard" */ "@/pages/channel/cospa.vue"),
	},
	{
		path: "/channel/10005",
		name:"music",
		meta:{title:"音乐",icon:'music', iconps:'144px',iconps_active:'120px'},
		component: () => import(/* webpackChunkName: "dashboard" */ "@/pages/channel/music.vue"),
	},
	{
		path: "/channel/10006",
		name:"delicacy",
		meta:{title:"美食",icon:'delicacy', iconps:'-240px',iconps_active:'264px'},
		component: () => import(/* webpackChunkName: "dashboard" */ "@/pages/channel/delicacy.vue"),
	},
	{
		path: "/channel/10007",
		name:"sports",
		meta:{title:"运动",icon:'sports', iconps:'240px',iconps_active:'216px'},
		component: () => import(/* webpackChunkName: "dashboard" */ "@/pages/channel/sports.vue"),
	},
	{
		path: "/channel/10008",
		name:"fashion",
		meta:{title:"时尚",icon:'fashion',iconps:'192px',iconps_active:'168px'},
		component: () => import(/* webpackChunkName: "dashboard" */ "@/pages/channel/fashion.vue"),
	},
];

const router = createRouter({
	history: createWebHashHistory(),
	routes: constantRoutes,
});

export function resetRouter() {
	const newRouter = router;
	(router as any).matcher = (newRouter as any).matcher; // reset router
}
router.beforeEach((_to, _from, next) => {
	next();
});
export default router;
